﻿package net.wangit.dev;

import net.wangit.context.ActionContext;
import net.wangit.context.ActionContextHelper;
import net.wangit.context.LocalContext;

public class ConsoleDomainUtil {

	private static final String DOMAIN = "net.wangit.dev.ConsoleDomainUtil.domain";

	public ConsoleDomainUtil() {
	}

	public static String getDomain(ActionContext ac) {
		return (String) ac.getSessionAttribute(ConsoleDomainUtil.DOMAIN);
	}

	public static String getAndSetDomain() {
		ActionContext ac = LocalContext.getLocalContext().getActionContext();
		return ActionContextHelper.getRequest2Session(ac, "component.domain",
				ConsoleDomainUtil.DOMAIN, "app");
	}
}
